package longcaisuyun.longcai.com.net;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2016/4/7.
 */
@HttpInlet(Net.HEARDPIC)
public class PostPic extends WHAsyPost<PostPic.Info> {
    public String driverid = "";
    public String picurl = "";

    public PostPic(String driverid, String picurl, AsyCallBack<Info> asyCallBack) {
        super(asyCallBack);
        this.driverid = driverid;
        this.picurl = picurl;
    }

    @Override
    protected Info parser(JSONObject object) {
        Info info = new Info();
        try {
            info.mesaage = object.getString("message");
            if (info.mesaage.equals("1")) {
                info.picurl = object.getString("picurl");
            }
            return info;
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    @Override
    protected boolean skipSecret(String key) {
        return key.equals("picurl");
    }

    public static class Info {
        public String picurl = "";
        public String mesaage = "";
    }
}
